package com.acaslless.core.exception;

import com.acaslless.core.enums.ResultEnum;
import lombok.Getter;

/**
 * feign异常处理
 *
 * @author haohan
 * @date 2025/4/10 15:31
 **/
@Getter
public class FeignException extends RuntimeException {

    private static final long serialVersionUID = -8065944395301734630L;

    private final Integer code;

    private final String msg;

    public FeignException(ResultEnum resultEnum) {
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
    }

    public FeignException(String msg) {
        this.code = ResultEnum.FAIL.getCode();
        this.msg = msg;
    }
}
